package com.ak;

import com.alibaba.nacos.api.NacosFactory;
import com.alibaba.nacos.api.config.ConfigService;
import com.alibaba.nacos.api.exception.NacosException;

import java.util.Properties;

public class demo1 {

    public static void main(String[] args) throws NacosException {
        // 使用nacos 来获取配置
        String serverAddr="47.100.104.187:8848";

        String dataID="nacos-simple-demo1.yml";

        String group="DEFAULT_GROUP";


        Properties properties =new Properties();
        properties.put("serverAddr",serverAddr);
        ConfigService service=NacosFactory.createConfigService(properties);

        String config=service.getConfig(dataID,group,5000);
        System.out.println(config);
    }
}
